<template>
  <div class="container">
    <div class="commons_top">
      <div class="commons_back" @click="$router.go(-1)">
        <img src="@/assets/index/back.png" />
      </div>
      <span class="commons_title">图书详情</span>
      <img
        src="@/assets/resource/share.png"
        class="share_icon"
        @click="shareBtn()"
      />
    </div>
    <!-- 书籍简介 -->
    <div class="book_container">
      <div class="book_item">
        <img
          :src="coverUrl(bookDetail.cover)"
          class="book_img"
          @error="errImg('book')"
        />
        <div class="book_introduce" v-if="bookDetail.name">
          <div class="book_name">{{ bookDetail.name }}</div>
          <div
            class="book_author"
            v-if="
              bookDetail.authorList !== undefined &&
                bookDetail.authorList.length > 0
            "
          >
            <span
              v-for="(item, index) in bookDetail.authorList.slice(0, 2)"
              :key="index"
            >
              {{ item.author }}
            </span>
          </div>
          <div class="book_author" v-else>暂无</div>
          <div class="recomm_rate">
            <el-rate
              v-model="bookDetail.score"
              disabled
              text-color="#FFE400"
              style="float:left;margin-right:0.1rem;marginTop:0.06rem"
            ></el-rate>
            <span class="score_text">{{ bookDetail.resourceScore }}</span>
          </div>
          <div class="book_num">
            <span>{{ bookDetail.commentNum }}人评分</span>
            <span class="book_num_browse"
              >{{
                bookDetail.browseNum ? bookDetail.browseNum : 50
              }}人浏览</span
            >
          </div>
          <div class="book_price_con">
            <span class="book_real_price" v-if="bookDetail.realPrice > 0"
              >¥{{ bookDetail.realPrice.toFixed(2) }}</span
            >
            <span class="book_real" v-else>免费</span>

            <span class="book_price" v-if="bookDetail.realPrice > 0"
              >¥{{ bookDetail.price.toFixed(2) }}</span
            >
          </div>
          <!--加入书架 -->
          <div class="book_shelf" :class="bookDetail.isBookShelf == 0 ? 'book_shelf' : 'book_shelf_remove' " @click="addShelf()">
            <span>{{
              bookDetail.isBookShelf == 0 ? "加入书架" : "移出书架"
            }}</span>
          </div>
          <div
            class="book_read"
            @click="tryRead(bookDetail.markid, bookDetail.id)"
            v-if="!free"
          >
            <span>试读</span>
          </div>
          <div
            class="book_read"
            v-else
            @click="tryRead(bookDetail.markid, bookDetail.id)"
          >
            阅读
          </div>
        </div>
      </div>
    </div>
    <!-- tab切换 -->
    <div class="book_tab" :style="!free?'paddingBottom:1.56rem':''">
      <el-tabs v-model="activeName" @tab-click="handleClick">
        <!-- 目录 -->
        <el-tab-pane label="目录" name="first">
          <div v-if="bookCatalog">
            <!-- <div v-for="item in bookCatalog" :key="item.markId"> -->
            <div
              v-for="(item, index) in bookCatalog"
              :key="index"
              class="book_catalogue"
              @click="free ? tryRead(item.markId, item.bookId) : ''"
            >
              <div
                class="linshipanduan"
                @click="index < Math.ceil(bookCatalog.length*0.2) ? tryRead(item.markId, item.bookId) : ''"
              >
                <span class="book_catalog">{{ item.chapterName }}</span>
                <div class="book_try" v-if="!free">
                  <div v-if="index < Math.ceil(bookCatalog.length*0.2)">
                    试读
                  </div>
                  <div v-else class="book_lock">
                    <img src="@/assets/resource/lockx2.png" alt="" />
                  </div>
                </div>
              </div>
            </div>
          </div>
        </el-tab-pane>
        <!-- 内容 -->
        <el-tab-pane label="内容" name="second">
          <div class="book_tit">简介</div>
          <div v-if="bookSynopsis" style="position:relative">
            <div class="book_collapse" :class="book_collapse_height">
              <div>
                {{ bookSynopsis }}
              </div>
            </div>
            <!-- <i
            class="el-icon-arrow-down book_collapse_button"
            @click="bookCollapse"
          ></i> -->
          <div  class="book_collaps_box"  @click="bookCollapse">
                        <i
              class="book_collapse_button"
              :class="
                book_collapse_height == `book_collapse_height`
                  ? book_put
                  : book_icon
              "

            ></i>
          </div>

          </div>
          <div class="book_collapse_null" v-else>暂无</div>

          <!-- 评论区 -->
          <div class="book_review">
            <div class="book_tit" style="margin-top:1.5rem">
              精选评论
              <div class="add_review" @click="addReview">
                <img
                  src="@/assets/courseDetails/review.png"
                  class="review_icon"
                />写留言
              </div>
            </div>
            <review
              :reviewData="reviewData"
              :reviewTotal="reviewTotal"
              :reviewType="reviewType"
              :postId="listQuery.oid"
              :listNull="listNull"
              :loading="loading"
              v-on:myList="agreeBtn($event)"
              :name="bookDetail.name"
            ></review>
          </div>

          <!-- <review v-on:myList="agreeBtn($event)" :name="bookDetail.name"></review> -->
        </el-tab-pane>
        <!-- 推荐 -->
        <el-tab-pane label="推荐" name="third">
          <div
            class="recomm_list"
            v-for="(item, index) in bookRecommend"
            :key="index"
          >
            <img
              class="recomm_cover"
              :src="coverUrl(item.cover)"
              @error="errImg('book')"
              @click="linkDet(item.id)"
            />
            <div class="recomm_con">
              <div class="recomm_name" @click="linkDet(item.id)">
                {{ item.name }}
              </div>
              <div class="recomm_author">
                {{ item.author ? item.author : "暂无" }}
              </div>
              <div class="recomm_rate">
                <el-rate
                  v-model="item.score"
                  disabled
                  text-color="#FFE400"
                  style="float:left;margin-right:0.1rem;marginTop:0.06rem"
                ></el-rate>
                <span class="score_text">{{ item.resourceScore }}</span>
                <span class="rate_num">{{ item.browseNum }}人评分</span>
              </div>
              <div class="recomm_intro">{{ item.synopsis }}</div>
            </div>
          </div>
        </el-tab-pane>
      </el-tabs>
    </div>

    <!-- <div class="nav"></div> -->
    <!-- footer -->
    <div class="book_footer" v-if="!free && level != 2">
      <div class="book_footer_vip" @click="openVip()">
        <span>开通VIP免费</span>
      </div>
      <div class="book_footer_buy" @click="payBtn"><span>立即购买</span></div>
    </div>
    <!-- 分享功能 -->
    <div class="share_box" v-if="shareDialog">
      <div class="share_main" ref="imageWrapper" v-if="!dataURL">
        <div class="share_header_box">
          <img
            class="header_cover"
            :src="coverUrl(personCover, 'files')"
            v-if="personCover"
            crossOrigin="anonymous"
          />
          <img src="@/assets/common/cover.png" class="header_cover" v-else />
          <span>{{ account }}</span>
          <span class="share_text">给您分享一堂好课</span>
        </div>
        <div class="share_cover">
          <img
            :src="coverUrl(bookDetail.cover)"
            class="share_cover_img"
            crossOrigin="anonymous"
            @error="errImg('book')"
          />
          <!-- <img class='share_cover_img' src='@/assets/course/cover.png' v-else> -->
        </div>
        <div class="share_title">
          {{
            bookDetail.name.length > 27
              ? bookDetail.name.substr(0, 27) + "..."
              : bookDetail.name
          }}
        </div>
        <div class="share_bottom">
          <div class="share_left">
            <div>长按识别图中小程序码</div>
            <div>了解更多课程</div>
          </div>
          <div class="share_right">
            <div class="qrcode" ref="qrCodeUrl" id="qrcode"></div>
          </div>
        </div>
      </div>
      <div class="domo">
        <img :src="dataURL" alt="" v-if="dataURL" class="share_picture" />
      </div>
      <div class="canvas_text">长按图片保存或发送给朋友</div>
      <div class="canvas_image">
        <img
          src="@/assets/common/delete_icon.png"
          class="delete_icon"
          @click="closeShare"
        />
      </div>
    </div>
  </div>
</template>

<script>
import {
  getBookDetails,
  getBookCatalogue,
  getBookRecommend
} from "@/api/resource.js";
import review from "@/components/review";
import { bookAddShelf, bookIsCheck } from "@/api/shelf.js";
import { Toast } from "mint-ui";
import { reviewAPI, agreeAPI } from "@/api/course.js";
import QRCode from "qrcodejs2";
import html2canvas from "html2canvas";
import "@static/css/common.css";
import { starColor } from "@/utils/static";
import { createOrderAPI, isPayCoursementAPI } from "@/api/order.js";

export default {
  name: "bookDet",
  components: {
    review
  },
  data() {
    return {
      free: false,
      bookId: "",
      starColor,
      bookDetail: [],
      tabLids: [{ name: "目录" }, { name: "内容" }, { name: "推荐" }],
      activeName: "first",
      // 目录
      bookCatalog: "",
      // 内容
      bookSynopsis: "",
      book_collapse_height: "book_collapse_height_one",
      starColor: "",
      // 推荐
      bookRecommend: "",
      isQuery: { resourceId: "", resourceType: "" },
      // 是否加入书架
      isAdd: 1,
      reviewTotal: null,
      reviewData: [],
      tabType: "detail",
      listQuery: {
        oid: ""
      },
      reviewType: "book",
      listNull: false,
      loading: false,
      shareDialog: false,
      dataURL: "",
      personCover: "",
      account: "",
      book_icon: "book_icon",
      book_put: "book_put",
      level: localStorage.getItem('level')
    };
  },
  mounted() {
    // 获取图书ID
    this.bookId = this.$route.query.id;
    this.isQuery.resourceId = this.bookId;
    this.getDetail();
  },
  methods: {
    // 请求图书数据
    getDetail() {
      getBookDetails(this.bookId).then(res => {
        this.bookDetail = res.data.data;
        this.bookSynopsis = res.data.data.synopsis;
        this.isQuery.resourceType = res.data.data.resourceType;
        this.getReviewList(); //获取评论列表
        // 判断是否是VIP
        if (this.bookDetail.messageCode === null) {
          this.free = 1;
        } else {
          this.free = false;
        }
      });
      // 请求图书目录
      getBookCatalogue({ bookId: this.bookId }).then(res => {
        this.bookCatalog = res.data.data;
      });
      // 请求图书推荐
      getBookRecommend({ id: this.bookId, num: 10 }).then(res => {
        console.log(this.bookId)
        this.bookRecommend = res.data.data;
      });
    },

    // tab切换按钮
    handleClick(tab, event) {},
    // 展开按钮
    bookCollapse() {
      if (this.book_collapse_height == "book_collapse_height") {
        this.book_collapse_height = "book_collapse_height_one";
      } else {
        this.book_collapse_height = "book_collapse_height";
      }
    },
    // 跳转图书详情页
    linkDet(id) {
      this.navigationFuc("bookDet", { id });
      this.$router.go(0);
       window.location.reload();
    },
    // 加入书架
    addShelf() {
      if (!localStorage.getItem("y-token")) {
        // 判断是否登陆
        this.$router.push({ name: "login" });
        return false;
      }
      bookAddShelf(this.isQuery).then(res => {
        if (res.data.code === 0) {
          this.getDetail();
          Toast(this.bookDetail.isBookShelf == 0 ? "已加入书架" : "移除书架");
        } else {
          Toast("加入书架失败");
        }
      });
    },
    getReviewList() {
      //获取评论列表
      let data = {
        pageNum: 1,
        pageSize: 5,
        resourceId: this.bookDetail.id,
        resourceType: 1 //1图书4视频5音频
      };
      this.loading = true;
      reviewAPI(data).then(res => {
        if (res.data.code == 0) {
          this.reviewData = res.data.data.list;
          this.reviewTotal = res.data.data.total;
          this.listNull =
            res.data.data.list && res.data.data.list.length > 0 ? false : true;
        } else {
          Toast(res.data.msg);
        }
        this.loading = false;
      });
    },
    addReview() {
      //去评论
      if (!localStorage.getItem("y-token")) {
        //判断是否登录
        this.$router.push({ name: "login" });
      } else {
        if(this.level != 2) {
          this.$router.push({
            name: "addReview",
            query: {
              resourceType: this.bookDetail.resourceType,
              resourceId: this.bookDetail.id,
              resourceName: this.bookDetail.name
            }
          });
        } else {
          Toast('请用个人账号登录进行评论')
        }
      }
    },
    agreeBtn(data) {
      //点赞 --- icon实现
      let that = this;
      let type = data.isAgree == 0 ? 1 : 0;
      agreeAPI({ commentId: data.id, type: type }).then(res => {
        if (res.data.code === 0) {
          //点赞成功
          this.getReviewList();
          Toast(data.isAgree == 0 ? "点赞成功" : "已取消点赞");
        } else {
          Toast(res.data.msg);
        }
      });
    },
    shareBtn() {
      //分享
      if (!localStorage.getItem("y-token")) {
        //判断是否登录
        this.$router.push({ name: "login" });
        return;
      }
      this.shareDialog = true;
      let that = this;
      that.$nextTick(() => {
        that.creatQrCode();
      });
      setTimeout(function() {
        html2canvas(that.$refs.imageWrapper, {
          useCORS: true,
          allowTaint: true,
          backgroundColor: null
        }).then(canvas => {
          that.dataURL = canvas.toDataURL();
        });
      }, 1000);
    },
    creatQrCode() {
      let text = window.location.href;
      let that = this;
      setTimeout(function() {
        let qrcode = new QRCode("qrcode", {
          width: 72,
          height: 66,
          text: text, // 二维码地址
          colorDark: "#000",
          colorLight: "#fff"
        });
      }, 500);
    },
    closeShare() {
      //关闭分享
      this.shareDialog = false;
    },
    // 开通VIP
    openVip() {
      this.navigationFuc("member");
    },

    // 立即购买
    payBtn() {
      let goodsList = [];
      goodsList.push({
        goodsId: this.bookDetail.id,
        goodsType: this.bookDetail.resourceType,
        num: 1,
        realPrice: this.bookDetail.realPrice
      });
      createOrderAPI({ buyType: 1, goodsList: goodsList }).then(res => {
        if (res.data.code === 0) {
          this.navigationFuc("orderList", {
            orderId: res.data.data,
            title: "图书"
          });
        } else {
          Toast(res.data.msg);
        }
      });
    },
    tryRead(markid, bookid) {
      if (!localStorage.getItem("y-token")) {
        // 判断是否登陆
        this.$router.push({ name: "login" });
        return false;
      }
      // 判读是否有markID
      if(markid){
        this.navigationFuc("ebook", { markid, bookid });
        let mess = this.bookDetail.messageCode
        localStorage.setItem('messageCode',mess)
      }else{
        Toast("该图书没有epub资源,暂不支持阅读")
      }
      //试读

    }
  }
};
</script>

<style scoped>
.container {
  height: 100%;
  width: 100%;
  position: absolute;
  top: 0px;
  bottom: 0px;
}
/* headerTitle */
.share_icon {
  width: 0.36rem;
  height: 0.36rem;
  margin: auto 0 auto 30%;
}

/* book布局 */
.book_container {
  padding: 0.2rem 0 0 0.2rem;
  overflow: hidden;
}
/* .book_item {
  display: flex;
  justify-content: space-around;
} */
.book_img {
  width: 2.52rem;
  height: 3.63rem;
  float: left;
  border-radius: 3%;
  box-shadow: 0.06rem 0.06rem 0.06rem #ddd;
}
.book_introduce {
  padding: 0.3rem 0 0 0.4rem;
  float: left;
  width: 4rem;
}
.book_name {
  color: #333;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-weight: bold;
}
.book_author {
  margin-top: 0.19rem;
  color: #b2b1c3;
  font-size: 12px;
}
.recomm_rate {
  overflow: hidden;
}
.score_text {
  color: #fd7068;
  font-weight: bold;
  font-size: 14px;
  display: inline-block;
  margin-top: -0.08rem;
}
.book_num {
  color: #b2b1c3;
  font-size: 12px;
}
.book_num_browse {
  margin-left: 0.4rem;
}
.book_price_con {
  padding: 0.1rem 0;
}
.book_real_price {
  color: #fd7068;
  font-size: 19px;
  font-weight: bold;
}
.book_real {
  color: #24b562;
  font-size: 19px;
  font-weight: bold;
}
.book_price {
  color: #b2b1c3;
  font-size: 12px;
  text-decoration: line-through;
  line-height: 0.1rem;
}
.share_box {
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.5);
  position: fixed;
  left: 0;
  z-index: 4000;
  top: 0;
}
.domo {
  width: 77%;
  margin: 0 auto;
  margin-top: 0.8rem;
}
.domo img {
  display: inline-block;
  min-height: 8rem;
  width: 100% !important;
}
.share_main {
  width: 77%;
  margin: 0 auto;
  min-height: 8rem;
  margin-top: 0.8rem;
  overflow: hidden;
  background: url("../../assets/course/bg.png");
  background-size: 100% 100%;
  padding: 0.58rem 0.3rem 0 0.3rem;
  box-sizing: border-box;
}
.share_header_box {
  display: flex;
  align-items: center;
  color: #333333;
  font-size: 14px;
}
.share_header_box .header_cover {
  height: 0.5rem;
  width: 0.5rem;
  margin-right: 0.16rem;
}
.share_header_box .share_text {
  color: #999;
  font-size: 12px;
  margin-left: 0.09rem;
}
.share_cover {
  height: 3.26rem;
  width: 100%;
  margin-top: 0.2rem;
}
.share_cover_img {
  height: 3.26rem;
  width: 100%;
}
.share_title {
  color: #121212;
  font-size: 15px;
  font-weight: bold;
  margin-top: 0.15rem;
  height: 0.76rem;
}
.share_bottom {
  margin-top: 0.9rem;
}
.share_left {
  float: left;
  color: #999da8;
  line-height: 0.4rem;
  font-size: 14px;
}
.share_right {
  float: right;
  margin-top: -0.2rem;
  height: 1.34rem;
  width: 1.45rem;
}
.canvas_text {
  text-align: center;
  color: #fff;
  font-size: 14px;
  padding-top: 0.35rem;
  padding-bottom: 0.4rem;
  border-radius: 0.14rem;
}
.canvas_image {
  width: 100%;
  text-align: center;
}
.delete_icon {
  height: 0.84rem;
  width: 0.84rem;
  display: inline-block;
  margin: 0 auto;
}
/* tab切换 */
.book_tab /deep/ .el-tabs__header {
  padding: 0.5rem;
}
.book_tab /deep/ .el-tabs__item.is-active {
  color: #ff7186;
  font-size: 18px;
}
.book_tab /deep/ .el-tabs__active-bar {
  background-color: #ff7186;
}
.book_tab /deep/ .el-tabs__nav-wrap::after {
  background-color: white;
}
.book_tab /deep/ .el-tabs__item {
  color: #b2b1c3;
}
.book_tab /deep/ .el-tabs__content {
  overflow: visible;
}
.book_tab /deep/ .el-tabs__header {
  margin: 0;
}
/* 目录 */
.book_catalog {
  height: 1.2rem;
  font-size: 14px;
  padding: 0 0 0 0.5rem;
  font-weight: bold;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 5rem;
}
.book_try {
  float: right;
  color: #ff7168;
  font-size: 14px;
  margin-right: 0.5rem;
  font-weight: bold;
}
.book_lock {
  float: right;
  margin-right: 0.6rem;
}
.book_lock img {
  width: 0.24rem;
  height: 0.24rem;
}
/* 内容 */
/* .nav {
  height: 2rem;
} */
.book_review {
  margin: 0 0.3rem;
}
.book_tit {
  color: #222222;
  font-size: 17px;
  margin: 0 0 0.3rem 0.3rem;
  /* margin: 0 0.5rem; */
}
.book_collapse {
  height: 3rem;
  overflow: hidden;
  font-size: 14px;
  color: #5e5f71;
  padding: 0 0.3rem;
  line-height: 0.8rem;
}
.book_collaps_box{
  height: 1rem;
  width: 1rem;
  position: absolute;
  bottom: -1rem;
  left: 50%;
  margin-left: -0.1rem;
}
.book_collapse_button {
  /* z-index: 2; */
  position: absolute;
  margin-top: 0.3rem;
}
.book_collapse_height {
  height: 100%;
}
.book_collapse_height_one {
  height: 3rem;
}
.book_collapse_null{
  color:#5e5f71;
  padding: 0 0.3rem;

}
.book_shelf {
  float: left;
  width: 1.6rem;
  height: 0.62rem;
  line-height: 0.62rem;
  background: #ff7168;
  color: #fefefe;
  font-size: 12px;
  text-align: center;
  font-weight: bold;
  border-radius: 0.06rem;
}
.book_shelf_remove{
  background: white;
  color:#B2B1C3 ;
  border: 1px solid #b2b1c3;
  box-sizing: border-box;
}
.book_read {
  float: left;
  margin-left: 0.3rem;
  width: 1.6rem;
  height: 0.62rem;
  line-height: 0.62rem;
  border: 1px solid #b2b1c3;
  box-sizing: border-box;
  color: #b2b1c3;
  font-size: 12px;
  text-align: center;
  font-weight: bold;
  border-radius: 0.06rem;
}
.book_icon {
  background: url("../../assets/resource/open.png") no-repeat;
  background-size: 100% 100%;
  /* background: url("../../assets/course/action.png") no-repeat center; */
  width: 0.3rem;
  height: 0.3rem;
}
.book_put {
  background: url("../../assets/resource/show.png") no-repeat;
  background-size: 100% 100%;
  /* background: url("../../assets/course/action.png") no-repeat center; */
  width: 0.3rem;
  height: 0.3rem;
}
/* 写留言 */
.add_review {
  height: 0.5rem;
  padding: 0 0.26rem;
  color: #fff;
  background: linear-gradient(
    -25deg,
    rgba(252, 116, 18, 1) 0%,
    rgba(247, 139, 62, 1) 100%
  );
  border-radius: 0.25rem;
  line-height: 0.5rem;
  float: right;
  font-weight: normal;
  font-size: 11px;
  margin-top: 0.1rem;
}
.review_icon {
  height: 0.27rem;
  width: 0.27rem;
  float: left;
  margin-top: 0.11rem;
  margin-right: 0.12rem;
}

/* 推荐 */
/* index_recomm 重磅推荐 */
.index_recomm {
  margin-top: 0.4rem;
}
.recomm_list {
  width: 100%;
  border-bottom: 0.02rem solid #eeeeee;
  padding: 0.3rem 0.4rem;
  display: flex;
  box-sizing: border-box;
}
.recomm_list:last-child {
  border-bottom: none;
}
.recomm_cover {
  width: 1.5rem;
  height: 2.1rem;
  border-radius: 0.1rem;
}
.recomm_con {
  flex: 1;
  margin-left: 0.32rem;
}
.recomm_name {
  width: 5rem;
  font-size: 16px;
  color: #5e5f71;
  overflow: hidden;
  font-weight: bold;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.recomm_author {
  margin: 0.1rem 0 0;
  color: #b2b1c3;
  font-size: 12px;
}
.recomm_rate {
  overflow: hidden;
}
.score_text {
  color: #fd7068;
  font-weight: bold;
  font-size: 14px;
  display: inline-block;
  margin-top: -0.08rem;
}
.rate_num {
  color: #5e5f71;
  font-size: 14px;
  font-weight: bold;
  margin-left: 0.16rem;
}
.recomm_intro {
  width: 100%;
  color: #5e5f71;
  font-size: 14px;
  overflow: hidden;
  word-break: break-all;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  text-overflow: ellipsis;
  display: -webkit-box;
}
/* book-footer */
.book_footer {
  width: 100%;
  position: fixed;
  left: 0;
  bottom: 0;
  height: 1.56rem;
  box-shadow: 0px -1px 42px 0px rgba(223, 223, 223, 0.6);
  display: flex;
  justify-content: space-around;
  padding: 0.29rem 0.3rem;
  box-sizing: border-box;
  background-color: white;
}
.book_footer_vip {
  width: 4.79rem;
  height: 0.98rem;
  background: #ff7168;
  color: #fbfbfb;
  font-size: 14px;
  line-height: 0.98rem;
  text-align: center;
  font-weight: bold;
  border-radius: 0.06rem;
}
.book_footer_buy {
  width: 1.91rem;
  height: 0.98rem;
  color: #ff7168;
  font-size: 14px;
  line-height: 0.98rem;
  text-align: center;
  font-weight: bold;
  border-radius: 0.06rem;
  border: 0.02rem solid #ff7168;
  box-sizing: border-box;
}
</style>
